home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93a.txt / 000067_icon-group-sender _Mon Feb 15 20:34:50 1993.msg < prev    next >
Internet Message Format  |  1993-04-21  |  850b

  1. Received: by cheltenham.cs.arizona.edu; Tue, 16 Feb 1993 05:24:37 MST
  2. Date: 15 Feb 93 20:34:50 GMT
  3. From: devries@arizona.edu  (K'vin D'Vries)
  4. Organization: U of Arizona CS Dept, Tucson
  5. Subject: A neat ICON trick
  6. Message-Id: <32341@optima.cs.arizona.edu>
  7. Sender: icon-group-request@cs.arizona.edu
  8. To: icon-group@cs.arizona.edu
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. I was working w/ a case stmt:
  13.  
  14. case x of {
  15.     <0 : foo()
  16.     >1 : bar()
  17.      1 : foobar()
  18.      0 : barfoo()
  19. }
  20.  
  21. but, this won't compile because '<0' and '>1' aren't full expr's.  But you
  22. can fix it by:
  23.  
  24. case x of {
  25.     0>x : foo()
  26.     1<x : bar()
  27.      1 : foobar()
  28.      0 : barfoo()
  29. }
  30.  
  31. This works, since 0>x or 1<x returns 'x' when either one of them succeeds; the
  32. case stmt then compares x w/ x, so the right func() is called.
  33.  
  34. K'vin
  35.